package com.sw.funfuck.discuss.service.impl;

import com.sw.funfuck.common.vo.PageResponse;
import com.sw.funfuck.discuss.dao.DiscussMapper;
import com.sw.funfuck.discuss.vo.response.DiscussQueryListResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sw.funfuck.discuss.service.DiscussService;
import com.sw.funfuck.discuss.vo.request.DiscussQueryRequest;

import java.util.List;

/**
 * @Desc: No Desc
 * @Author: wusonghe
 * @Date: 2019/3/4 16:08
 */
@Service
public class DiscussServiceImpl implements DiscussService {

    @Autowired
    private DiscussMapper discussMapper;

    @Override
    public PageResponse queryDiscussList(DiscussQueryRequest request) {

        PageResponse pageResponse = new PageResponse();
        pageResponse.setTotal(10);
        pageResponse.setOffset(request.getOffset());

        List<DiscussQueryListResponse> listResponses = discussMapper.queryQueryListResponse(request);
        pageResponse.setData(listResponses);

        return pageResponse;
    }
}
